package com.label.grade.controller;/**
 * @author zhf
 * @date 2023/7/7 16:06
 * @version 1.0
 */

import com.label.Config.Logger.LogAnnotation;
import com.label.Model.Common.ResponseBean;
import com.label.grade.service.impl.UndergraGradeServiceImpl;
import org.eclipse.jetty.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author i++
 * 项目：gradeSummary
 * 描述：成绩汇总
 * @date 2023/7/7 16:06
 **/
@RestController
@CrossOrigin
@RequestMapping("/learninganalysis/gradeinfo")
public class GradeSummaryContrller {
    @Autowired
    UndergraGradeServiceImpl undergraGradeDoService;

    @LogAnnotation(module = "学生成绩汇总",operator = "通过学号获取学生成绩")
    @GetMapping("/gradeSummary/get/{stuNumber}")
    public ResponseBean gradeSummary(@PathVariable String stuNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.caculateGradeSummary(stuNumber));
    }

    @LogAnnotation(module = "学生一课学情分析",operator = "通过学号获取页面数据")
    @GetMapping("/learningAnalysis/get/{stuNumber}")
    public ResponseBean learningAnalysis(@PathVariable String stuNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectGradeLearnAnalysis(stuNumber));
    }

    @LogAnnotation(module = "成绩列表",operator = "通过导员或者班导师工号获取成绩列表数据")
    @GetMapping("/gradeList/get/{teacherNumber}")
    public ResponseBean gradeList(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectGradeList(teacherNumber));
    }

    @LogAnnotation(module = "成绩列表",operator = "通过育人团队负责人工号获取成绩列表数据")
    @GetMapping("/gradeForLeaderList/get/{teacherNumber}")
    public ResponseBean gradeForLeaderList(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectGradeForLeaderList(teacherNumber));
    }

    @LogAnnotation(module = "学生详细成绩展示部分",operator = "通过学号获取学生详细成绩")
    @GetMapping("/detailscore/get/{stuNumber}")
    public ResponseBean detailScore(@PathVariable String stuNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectDetailScore(stuNumber));
    }

    @LogAnnotation(module = "班导师其他成绩展示部分",operator = "通过老师工号获取学生其他成绩")
    @GetMapping("/otherGrade/get/{teacherNumber}")
    public ResponseBean otherGrade(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectOtherGrade(teacherNumber));
    }

    @LogAnnotation(module = "育人团队其他成绩展示部分",operator = "通过老师工号获取学生其他成绩")
    @GetMapping("/otherGradeForLeader/get/{teacherNumber}")
    public ResponseBean otherGradeForLeader(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectOtherGradeForLeader(teacherNumber));
    }

    @LogAnnotation(module = "获取课程成绩单（辅导员）",operator = "通过学号获取课程成绩单（辅导员）")
    @GetMapping("/courseScoreDetail/get/{stuNumber}")
    public ResponseBean courseScoreDetail(@PathVariable String stuNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.selectCourseScoreDetail(stuNumber));
    }

    @LogAnnotation(module = "专业排名对比（班导师）",operator = "通过班导师工号获取其团队所带班级专业排名对比（班导师）")
    @GetMapping("/comparisonOfProfessionalRankingsForMentor/get/{teacherNumber}")
    public ResponseBean comparisonOfProfessionalRankingsForMentor(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.comparisonOfProfessionalRankingsForMentor(teacherNumber));
    }

    @LogAnnotation(module = "专业排名对比（育人团队）",operator = "通过育人团队工号获取其团队所带班级专业排名对比（育人团队）")
    @GetMapping("/comparisonOfProfessionalRankingsForMentorLeader/get/{teacherNumber}")
    public ResponseBean comparisonOfProfessionalRankingsForMentorLeader(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.comparisonOfProfessionalRankingsForMentorLeader(teacherNumber));
    }

    @LogAnnotation(module = "专业排名对比（辅导员）",operator = "通过辅导员工号和所选对比专业查看所带班级专业排名对比（辅导员）")
    @GetMapping("/comparisonOfProfessionalRankingsForInstructor/get")
    public ResponseBean comparisonOfProfessionalRankingsForInstructor(@RequestParam String teacherNumber,@RequestParam String major){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.comparisonOfProfessionalRankingsForInstructor(teacherNumber,major));
    }

    @LogAnnotation(module = "班级间学分绩点对比（辅导员）",operator = "通过辅导员工号和所选对比专业查看所带班级学分绩点情况（辅导员）")
    @GetMapping("/gradeComparison/get")
    public ResponseBean gradeComparison(@RequestParam String teacherNumber,@RequestParam String major){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.gradeComparison(teacherNumber,major));
    }

    @LogAnnotation(module = "班级间学分绩点对比（班导师）",operator = "通过班导师工号查看所在育人团队带班级学分绩点情况")
    @GetMapping("/gradeComparisonforMentor/get/{teacherNumber}")
    public ResponseBean gradeComparisonforMentor(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.gradeComparisonforMentor(teacherNumber));
    }

    @LogAnnotation(module = "班级间学分绩点对比（育人团队）",operator = "通过育人团队负责人工号查看所在育人团队带班级学分绩点情况")
    @GetMapping("/gradeComparisonforLeader/get/{teacherNumber}")
    public ResponseBean gradeComparisonforLeader(@PathVariable String teacherNumber){
        return new ResponseBean(HttpStatus.OK_200,"查找成功",undergraGradeDoService.gradeComparisonforLeader(teacherNumber));
    }
}
